package com.key.web_admin.controller;

import com.key.common.base.RespResult;
import com.key.modules.dto.*;
import com.key.modules.service.WExceptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/wException")
public class WExceptionController {

    @Autowired
    private WExceptionService wExceptionService;

    @PostMapping("/addWException")
    public RespResult addWException(@RequestBody WExceptionDTO wExceptionDTO){

        return wExceptionService.addWException(wExceptionDTO);
    }

    @GetMapping("/findAllWException")
    public RespResult findAllWException(@RequestBody WConditionDTO wConditionDTO){

        return wExceptionService.findAllWException(wConditionDTO);
    }

    @GetMapping("/findWExceptionById")
    public RespResult findWExceptionById(@RequestParam("id") Integer id){

        return wExceptionService.findWExceptionById(id);
    }

    @PostMapping("/updateWException")
    public RespResult updateWException(@RequestBody WExceptionDTO wExceptionDTO){

        return wExceptionService.updateWException(wExceptionDTO);
    }

    @PostMapping("/deleteWException")
    public RespResult deleteWException(@RequestBody List<Integer> ids){

        return wExceptionService.deleteWException(ids);
    }

    @PostMapping("/updateHState")
    public RespResult updateHState(@RequestBody HComplainDTO hComplainDTO){

        return wExceptionService.updateHState(hComplainDTO);
    }

    @PostMapping("/updateFState")
    public RespResult updateFState(@RequestBody FComplainDTO fComplainDTO){

        return wExceptionService.updateFState(fComplainDTO);
    }

}
